package com.googlecode.lookie.platform.image.resource;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class FileResource
    extends AbstractResource
    implements NamedResource
{

    private File file;

    public FileResource( File file )
    {

        this.file = file;
    }

    public String getName()
    {

        return file.getName();
    }

    public InputStream createInputStream()
        throws ResourceException
    {

        try
        {
            return new FileInputStream( file );
        }
        catch ( FileNotFoundException e )
        {
            throw new ResourceException( e );
        }
    }

}
